home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1984-07-08 | 3.8 KB | 109 lines |
- 10 ' File: AMERIC.BAS
- 20 '
- 30 ' ** NATIONS AND CAPITALS OF THE AMERICAS **
- 40 '
- 50 FOR N=1 TO VAL(RIGHT$(TIME$,2)):X=RND:NEXT N
- 60 M$=" NATIONS AND CAPITALS OF THE AMERICAS"+CHR$(13)+STRING$(40,42)
- 70 SCREEN 0,0,0:COLOR 7,0,0:WIDTH 40:KEY OFF:CLS:PRINT M$
- 80 PRINT:PRINT "This tutorial, multiple-choice program
- 90 PRINT "challenges you to learn and recall the
- 100 PRINT "capital cities of the nations of the
- 110 PRINT "Americas -- North, Central and South
- 120 PRINT "America.":PRINT
- 130 PRINT "The program continues repeating a ques-
- 140 PRINT "tion as long as you are making in-
- 150 PRINT "correct responses. Watch the selections
- 160 PRINT "change somewhat with each incorrect
- 170 PRINT "response, however -- the changes pro-
- 180 PRINT "vide clues to the correct answer.
- 190 LOCATE 24,1:PRINT "Strike any key to begin ...";
- 200 DEF SEG=0:POKE 1050,PEEK(1052)
- 210 K$=INKEY$:IF K$="" THEN 210
- 220 CLS:PRINT M$
- 230 DIM I$(38,4)
- 240 FOR X=1 TO 38:READ N:FOR Y=1 TO 4:READ I$(X,Y):NEXT Y:NEXT X
- 250 X=INT(38*RND)+1
- 260 FOR N=1 TO 3:Q$(N)=I$(X,N+1):NEXT N
- 270 Q$(4)=I$(INT(38*RND)+1,INT(3*RND)+2)
- 280 FOR N=1 TO 3
- 290 IF Q$(4)=Q$(N) THEN 270
- 300 NEXT N
- 310 Q$(5)="None of the above"
- 320 CR=INT(4*RND)+1
- 330 FOR N=1 TO 4
- 340 C=0
- 350 R$(N)=Q$(INT(4*RND)+1)
- 360 C=C+1:IF C < 10 THEN 390
- 370 LOCATE 3,1:COLOR 23,0
- 380 PRINT "PLEASE WAIT ...":COLOR 7,0
- 390 IF N=1 THEN 430
- 400 FOR Y=1 TO N-1
- 410 IF R$(Y)=R$(N) THEN 350
- 420 NEXT Y
- 430 NEXT N
- 440 R$(5)=Q$(5)
- 450 CLS:PRINT M$
- 460 PRINT "Which of the following is the capital of"
- 470 PRINT I$(X,1)" (1-5)?":PRINT
- 480 FOR N=1 TO 5:PRINT TAB(5)N"- "R$(N):NEXT N:PRINT
- 490 K$=INKEY$:IF K$="" THEN 490
- 500 IF K$<"1" OR K$>"5" THEN 490
- 510 PRINT K$
- 520 NT=NT+1
- 530 IF R$(VAL(K$))=I$(X,2) THEN 550
- 540 PRINT:PRINT "Sorry, that is not correct.":GOSUB 570:GOTO 260
- 550 PRINT:PRINT "That is correct."
- 560 NC=NC+1:GOSUB 570:GOTO 250
- 570 COLOR 0,7
- 580 LOCATE 17,1
- 590 SC=INT(100*NC/NT)
- 600 PRINT NC"correct out of"NT;SPC(32-POS(0))
- 610 PRINT
- 620 PRINT SPC(1)"for a score of"SC"%"SPC(32-POS(0))
- 630 COLOR 7,0
- 640 LOCATE 20,1
- 650 PRINT "Strike the SPACE BAR to continue (or ";
- 660 PRINT "the X key to end the quiz) ...";
- 670 K$=INKEY$:IF K$="" THEN 670
- 680 IF K$=CHR$(32) THEN RETURN
- 690 IF K$="X" OR K$="x" THEN WIDTH 80:END
- 700 GOTO 670
- 710 DATA 1,Antigua and Barbuda,St. John's,Codrington,Falmouth
- 720 DATA 2,The Bahamas,Nassau,Freeport,Andras I.
- 730 DATA 3,Barbados,Bridgetown,Mt. Hillaby,Speightstown
- 740 DATA 4,Belize,Belize City,Stann Creek,Corozal
- 750 DATA 5,Bermuda,Hamilton,Saint George,Somerset I.
- 760 DATA 6,Canada,Ottawa,Montreal,Toronto
- 770 DATA 7,Costa Rica,San Jose,Alajuela,Cartago
- 780 DATA 8,Cuba,Havana,Santiago de Cuba,Camaguey
- 790 DATA 9,Dominica,Roseau,Portsmouth,Layou
- 800 DATA 10,Dominican Republic,Santo Domingo,Moca,Las Matas
- 810 DATA 11,El Salvador,San Salvador,Santa Ana,Sonsonate
- 820 DATA 12,Greenland,Nuuk,Angmagssalik,Thule
- 830 DATA 13,Grenada,St. George's,Carriacon Island,Petit Martinique Island
- 840 DATA 14,Guatemala,Guatemala City,Puerto Barrios,Amatitian
- 850 DATA 15,Haiti,Port-au-Prince,Cap-Haitien,Saint-Marc
- 860 DATA 16,Honduras,Tegucigalpa,San Pedro Sula,La Ceiba
- 870 DATA 17,Jamaica,Kingston,Port Maria,Savanna Ia Mar
- 880 DATA 18,Mexico,Mexico City,Guadalajara,Monterrey
- 890 DATA 19,Netherlands Antilles,Willemstad,Curacao,Aruba
- 900 DATA 20,Nicaragua,Managua,Leon,Chinandega
- 910 DATA 21,Panama,Panama,Colon,La Chorrera
- 920 DATA 22,Saint Kitts-Nevis,Basseterre,Saint Christopher,Nevis
- 930 DATA 23,Saint Lucia,Castries,Soufriere,Vieux Fort
- 940 DATA 24,Saint Vincent and the Grenadines,Kingstown,Georgetown,Canouan
- 950 DATA 25,Trinidad and Tobago,Port-of-Spain,San Fernando,Trinidad
- 960 DATA 26,United States of America (USA),Washington D.C.,New York City,Chicago
- 970 DATA 27,Argentina,Buenos Aires,Cordoba,La Plata
- 980 DATA 28,Bolivia,LaPaz,Santa Cruz,Cochabamba
- 990 DATA 29,Brazil,Brasillia,Salvador,Porto Alegre
- 1000 DATA 30,Chile,Santiago,Valparaiso,Concepcion
- 1010 DATA 31,Colombia,Bogota,Medellin,Cali
- 1020 DATA 32,Ecuador,Quito,Guayoquil,Cuenca
- 1030 DATA 33,Guyana,Georgetown,Mahaica,Skeldon
- 1040 DATA 34,Paraguay,Asuncion,San Pedro,Concepcion
- 1050 DATA 35,Peru,Lima,Pisco,Iquitos
- 1060 DATA 36,Suriname,Paramaribo,Nieuw,Nickerie
- 1070 DATA 37,Uraguay,Montevideo,Melo,Paysandu
- 1080 DATA 38,Venezuela,Caracas,Maracaibo,Valencia
-